using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using CodRevit.DockPanes;

namespace CodRevit.Commands
{
    [Transaction(TransactionMode.Manual)]
    public class CozeBotCommand : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            var uiapp = commandData.Application;
            var dpid = new DockablePaneId(CozeBotDockablePane.PaneId.Guid);
            var dp = uiapp.GetDockablePane(dpid);

            if (dp.IsShown())
            {
                CozeBotDockablePane.Hide(uiapp);
            }
            else
            {
                CozeBotDockablePane.Show(uiapp);
            }
            return Result.Succeeded;
        }
    }
}